]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Port to MetaSoundPlayer for emitting sounds
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 13 Dec 2018 19:32:16 +0000 (20:32 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Wed, 9 Jan 2019 23:09:18 +0000 (23:09 +0000)
Move away from ShellGlobal API, which is too tightly coupled to
libcanberra-gtk. The app ID/name seem unused in canberra, so we
may simplify this to a single case.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/327

js/ui/messageTray.js

index eebc93fdf4a26b542af00c8b0aeaefee034bbb33..fc4e00c9d97630e2b8a02d846a2e0e3cbd9ae6f6 100644 (file)
@@ -448,27 +448,11 @@ var Notification = new Lang.Class({
             return;
         }
 
-        if (this._soundName) {
-            if (this.source.app) {
-                let app = this.source.app;
-
-                global.play_theme_sound_full(0, this._soundName,
-                                             this.title, null,
-                                             app.get_id(), app.get_name());
-            } else {
-                global.play_theme_sound(0, this._soundName, this.title, null);
-            }
-        } else if (this._soundFile) {
-            if (this.source.app) {
-                let app = this.source.app;
-
-                global.play_sound_file_full(0, this._soundFile,
-                                            this.title, null,
-                                            app.get_id(), app.get_name());
-            } else {
-                global.play_sound_file(0, this._soundFile, this.title, null);
-            }
-        }
+        let player = global.display.get_sound_player();
+        if (this._soundName)
+            player.play_from_theme(this._soundName, this.title, null);
+        else if (this._soundFile)
+            player.play_from_file(this._soundFile, this.title, null);
     },
 
     // Allow customizing the banner UI: